package cn.billi.cloud.basic.service.controller;

import java.util.Arrays;
import java.util.List;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import lombok.extern.slf4j.Slf4j;

@RestController
@RequestMapping(value = "/home", produces = MediaType.APPLICATION_JSON_VALUE)
@Slf4j
public class HomeController {
  @Value("${server.port}")
  private Integer port;

  private Integer callCount = 0;

  @GetMapping(value = "users")
  public List<String> queryUserNames() {
    callCount++;
    System.out.println(port + " call: " + callCount);

    return Arrays.asList("三国演绎", "红楼梦", "水浒传", "西游记");
  }
}
